import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/home_banner_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class HomeBannerEntity {
	late int code;
	late HomeBannerObj obj;
	late String msg;

	HomeBannerEntity();

	factory HomeBannerEntity.fromJson(Map<String, dynamic> json) => $HomeBannerEntityFromJson(json);

	Map<String, dynamic> toJson() => $HomeBannerEntityToJson(this);

	HomeBannerEntity copyWith({int? code, HomeBannerObj? obj, String? msg}) {
		return HomeBannerEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeBannerObj {
	late List<HomeBannerObjList> list;
	late int total;

	HomeBannerObj();

	factory HomeBannerObj.fromJson(Map<String, dynamic> json) => $HomeBannerObjFromJson(json);

	Map<String, dynamic> toJson() => $HomeBannerObjToJson(this);

	HomeBannerObj copyWith({List<HomeBannerObjList>? list, int? total}) {
		return HomeBannerObj()
			..list= list ?? this.list
			..total= total ?? this.total;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class HomeBannerObjList {
	late int id;
	late String title;
	late String imageUrl;
	late int sort;
	late String publishTime;
	late String createTime;
	late String updateTime;
	late int cid;

	HomeBannerObjList();

	factory HomeBannerObjList.fromJson(Map<String, dynamic> json) => $HomeBannerObjListFromJson(json);

	Map<String, dynamic> toJson() => $HomeBannerObjListToJson(this);

	HomeBannerObjList copyWith({int? id, String? title, String? imageUrl, int? sort, String? publishTime, String? createTime, String? updateTime, int? cid}) {
		return HomeBannerObjList()
			..id= id ?? this.id
			..title= title ?? this.title
			..imageUrl= imageUrl ?? this.imageUrl
			..sort= sort ?? this.sort
			..publishTime= publishTime ?? this.publishTime
			..createTime= createTime ?? this.createTime
			..updateTime= updateTime ?? this.updateTime
			..cid= cid ?? this.cid;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}